
package com.kweative.lingua.demo;

import com.kweative.cluster.Cluster;
import com.kweative.lingua.demo.controller.Chat;
import com.kweative.lingua.demo.controller.User;
import com.kweative.lingua.demo.model.ChatMessage;
import com.kweative.lingua.demo.model.UserModel;
import com.kweative.lingua.server.Application;
import com.kweative.lingua.server.structures.DataStore;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Stack;

/**
 *
 * @author henrik
 */
public class Demo extends Application {
    
    HashMap<String, UserModel> users;
    LinkedList<ChatMessage> messages;

    public Demo() {
        super("demo","com.kweative.lingua.demo.controller");
        addController(new Chat());
        addController(new User());
    }

    @Override
    public void onApplicationLoad() {
        super.onApplicationLoad();
        users = (HashMap<String, UserModel>) Cluster.get("users",new HashMap<String, UserModel>());
        messages = (LinkedList<ChatMessage>) Cluster.get("messages",new LinkedList<ChatMessage>());
    }

    
    public HashMap<String,UserModel> users() {
        return (HashMap<String, UserModel>) Cluster.get("users");
    }
    public LinkedList<ChatMessage> messages() {
        return (LinkedList<ChatMessage>) Cluster.get("messages");
    }
}
